package com.hn.common.utils;

import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;

/**
 * 描述:
 *
 * @author fei
 * @date 2020-01-14 10:49
 */
public class MailUtils {

    public static void send(String to,String content){
        send(to,"【法务】文书模板地址",content);
    }

    public static void send(String to,String subject,String content){
        MailAccount mailAccount = new MailAccount();
        mailAccount.setHost("smtp.qq.com");
        mailAccount.setPort(587);
        mailAccount.setFrom("927664721@qq.com");
        mailAccount.setUser("927664721@qq.com");
        mailAccount.setPass("abqxvwkgwfmxbdeg");
        MailUtil.send(mailAccount,to,subject,
                content,false);
    }

    public static void main(String[] args) {
        send("shilvfei@dingtalk.com","ceshi");
    }
}
